2 require_once "modules/Notes/Note.php";
4 class NotesTest extends Sugar_PHPUnit_Framework_TestCase
6 public function setUp()
8 $GLOBALS['current_user'] = SugarTestUserUtilities::createAnonymousUser();
11 public function tearDown()
13 SugarTestUserUtilities::removeAllCreatedAnonymousUsers();
14 unset($GLOBALS['current_user']);
20 public function testCreateProperNameFieldContainsFirstAndLastName()
22 require_once("modules/Contacts/Contact.php");
23 $contact = new Contact();
24 $contact->first_name = "Josh";
25 $contact->last_name = "Chi";
26 $contact->salutation = "Mr";
27 $contact->title = 'VP Operations';
28 $contact->disable_row_level_security = true;
29 $contact_id = $contact->save();
32 $note->contact_id = $contact_id;
33 $note->disable_row_level_security = true;
34 $note->fill_in_additional_detail_fields();
36 $this->assertContains($contact->first_name,$note->contact_name);
37 $this->assertContains($contact->last_name,$note->contact_name);
39 $GLOBALS['db']->query('DELETE FROM contacts WHERE id =\''.$contact_id.'\'');